<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5 Transitional//EN">
<%@ page pageEncoding="UTF-8" %>
<%@ page import="jp.co.technotree.apl.api.common.Message,jp.co.technotree.common.ApplicationManager" %>
<%@page import="jp.co.technotree.apl.cmd.order.Odr1000Bean"%>
<jsp:useBean id="formBean" class="jp.co.technotree.apl.cmd.order.Odr1000Bean" scope="request" />
<%@page import="jp.co.technotree.apl.api.common.FwCom"%>

<%
	ApplicationManager appMng = ApplicationManager.getInstance();	//アプリケーションマネージャの取得（パス等）

%>
<html>
<head>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes"/>
<link rel='stylesheet' type='text/css' href='../../common/css/order/odr1000.css' >
<link rel='stylesheet' type='text/css' href='../../common/css/popUp.css' >

<script type='text/javascript' src='../../common/js/popUp.js'></script>
<script type='text/javascript' src='../../common/js/NumKeyBoard2.js'></script>


<!-- ITEM-DROPDOWN START -->
<link rel="stylesheet" href="../../common/js/dropdown/dropdown.css" type="text/css">
<script src="../../common/js/dropdown/dropdown.js" type="text/javascript"></script>
<!-- ITEM-DROPDOWN END -->

<style type="text/css">

	.mainTbl_Left{
		 border: 0px solid #CCCCFF;
		 height:150px;
		 width: 210px;
		 margin-top:-250px;
		 align:center;
	}

	.mainTbl_Right{
		 border: 0px solid #CCCCFF;
		 height:550px;
	}

	.clearBtn {
		width: 100px;
		height:50px;
		font-size:18px;
	}

	.confirmBtn {
		width: 80px;
		height:50px;
		font-size:18px;
	}
	.confirmBtn2 {
		width: 120px;
		height:50px;
		font-size:18px;
	}

	.selTitle{
	 font-size:16px;
	 valign:top;

	}

	.ImageZone{
	position:absolute;
	top :100px;
	left:640px;
	 visibility: visible;

	 width: 200px;
	 height:200px;
	 }

.searchBtn{
	width: 80px;
	height:50px;
	font-size:18px;
	margin-top:1px;
	background-image: -webkit-gradient(linear, left top, left bottom, from(#6699CC), to(#6699CC),color-stop(0.7,#6688CC));
	color: #fff;
	font-weight:bold;
	text-shadow: -1px 2px rgba(0,0,0,0.2);
	-webkit-border-radius:10px;

	position:relative; z-index:1;
}


.backBtn{
	width: 80px;
	height:50px;
	font-size:18px;
	margin-top:1px;
	background-image: -webkit-gradient(linear, left top, left bottom, from(#6699CC), to(#6699CC),color-stop(0.7,#6688CC));
	color: #fff;
	font-weight:bold;
	text-shadow: -1px 2px rgba(0,0,0,0.2);
	-webkit-border-radius:10px;

	position:relative; z-index:1;
}



.orderBtn{
	width: 80px;
	height:50px;
	font-size:18px;
	margin-top:1px;
	background-image: -webkit-gradient(linear, left top, left bottom, from(#6699CC), to(#6699CC),color-stop(0.7,#6688CC));
	color: #fff;
	font-weight:bold;
	text-shadow: -1px 2px rgba(0,0,0,0.2);
	-webkit-border-radius:10px;

	position:relative; z-index:1;
}

.clearBtn{
	width: 90px;
	height:50px;
	font-size:18px;
	margin-top:1px;
	background-image: -webkit-gradient(linear, left top, left bottom, from(#6699CC), to(#6699CC),color-stop(0.7,#6688CC));
	color: #fff;
	font-weight:bold;
	text-shadow: -1px 2px rgba(0,0,0,0.2);
	-webkit-border-radius:10px;

	position:relative; z-index:1;
}



 	 /*-------------------------*/
	 /* dropdown.css*/
	 /*-------------------------*/
	div.dropdown-panel {
		font-size:12px;
		width:150px;
		height:200px;
		border-top:solid 1px #888;
		border-left:solid 1px #888;
		border-right:solid 1px #555;
		border-bottom:solid 1px #000;
		background-color:#fff;
		position:absolute;
		z-index:900;
		display:none;
	}

	div.dropdown-panel-in {
		width:150px;
		height:200px;
		border-top:solid 1px #fff;
		border-left:solid 1px #fff;
		border-right:solid 1px #888;
		border-bottom:solid 1px #888;
		background-color:#eee;

	}

	div.dropdown-panel-in div.header{
		width:100%;
		height:20px;
		border-bottom:solid 1px #000;
		background-color:#acf;
	}

	div.dropdown-panel-in div.drop-contents{
		position:relative;
		width:100%;
		height:176px;
		overflow-y:scroll;

	}

	div.dropdown-panel-in div.footer{
		position:relative;
		width:100%;
		height:2px;
		border-top:solid 1px #000;
		background-color:#cef;
		overflow:hidden;
		
	}


	div.dropdown-panel table {
		font-size:12px;
	}

	div.drop-contents table {
		width:100%;
		font-size:12px;
	}

	div.drop-contents table tbody tr{
		height:18px;
		cursor:hand;
	}
	div.drop-contents table tbody th{
		height:18px;
	}
	div.drop-contents table tbody td{
		padding-top:2px;
		padding-bottom:2px;
		padding-left:3px;
		padding-right:3px;
		height:18px;
	}



	img {
	     max-height:180px;
	     max-width:330px;
	     height :auto;
	     width :auto;
	    } 


</style>



<script language='javascript'>

//画面固定
//document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);


//<!-- NumKeyBoard START -->
var clsNKB = new CNumKeyBoard();
function onInit(){


	//発注完了後、メッセーを出してメイン画面に遷移
	var stateFlg = "<%=formBean.getStateFlg()%>";
	
	var afterFunc="nextPageJump('top1000');"
	if(stateFlg == "top"){
		//発注処理を正常に完了しました
		alert_Info2("<%=Message.getMessage("INF00020").replace("$1", "発注処理")%>",afterFunc);
	}
	//---------------------------------------------



/* 	var delvOdrObj = document.getElementById("delvOdr"); 	//出庫オーダー
	var useMethObj = document.getElementById("useMeth");	//使用用途
	var usrListObj = document.getElementById("usrList");	//発注担当者
	var useUsrObj = document.getElementById("useUsr");	    //使用者
*/



	var panel = document.getElementById("dropdown-panel");
	var frm=document.main;
	var findItemCdObj=frm["findItemNo"];
	if (findItemCdObj!=null) {
		var targetList = [ findItemCdObj ];
		dropdown = new CItemDropDownList(targetList,panel,"drop-contents");
		dropdown.setKeyUpEvent(text_onKeyUp);
		dropdown.setSelectEvent(list_onSelect);
		dropdown.serverURL="../itm1099/itm1099";
	}


	//-------------------------------------------------------------------------
	//<!-- NumKeyBoard START -->
	ProcStart	= new Date();

	clsNKB.init("NumKeyBoardID");
//	clsNKB.parentElement	= document.getElementById("BodyBlock");

	clsNKB.textFontSize		= 20;
	clsNKB.buttonFontSize	= 30;
	clsNKB.boxX				= -200;
	clsNKB.boxY				= 0;
	clsNKB.boxBalloonOffset	= 210;
	//<!-- NumKeyBoard END -->
	//-------------------------------------------------------------------------


}


//-------------------------------------------------------------------------
//<!-- ITEM-DROPDOWN START -->
var dropdown = null;

var inputDateTime = null;
var timerId = null;
var eventSrc={};
function text_onKeyUp(object,sender,evt){
	var value = sender.value;
	eventSrc.object = object;
	eventSrc.sender = sender;
	eventSrc.evt = evt;
	inputDateTime = new Date();

//-----------------------------------------------

	//小文字を大文字へ
	sender.value = sender.value.toUpperCase();
	value = sender.value;

	//品番自動ハイフン「-」を付ける
	var chkLen=5;
	if(event.keyCode != 0008){
		//指定の桁以上ならスタート
		if(value.length>=chkLen){
			var hikaku = value.substring(chkLen, chkLen+1);
			if(hikaku != "-"){
				var frontValue = value.substring(0, chkLen);
				var backValue  = value.substring(chkLen, value.length);
				sender.value=frontValue+"-"+backValue;
			}
		}
	}
	//-----------------------------------------------

	if ( value.length >= <%=formBean.getGohoKensu() %> ){
		if ( evt.keyCode == 37 || evt.keyCode == 39 ){

		}else{
			if ( timerId == null ){
				// 連続送信防止
				timerId = window.setTimeout(function(){text_onTimeOut(object,sender,evt);},500);
			}
		}
	}
}

/**
* 一定時間入力が止まった場合に動作
*/
function text_onTimeOut(object,sender,evt){
	var nowDateTime = new Date();
	var lngTime = (nowDateTime.getTime()-inputDateTime.getTime());
	if ( lngTime >= 1000 ){
		timerId = null;
		xmlRequest(object,sender,evt);
	}else{
		timerId = window.setTimeout(function(){text_onTimeOut(eventSrc.object,eventSrc.sender,eventSrc.evt);},500);
	}
}

/**
* XML要求処理
*/
function xmlRequest(object,sender,evt){
	//alert(evt.keyCode);
	var table = document.getElementById("drop-contents");
	table.innerHTML="";

	var top = calculateOffsetTop(sender);
	var left = calculateOffsetLeft(sender);
	var height = sender.offsetHeight;
	var panel = document.getElementById("dropdown-panel");
	panel.style.top=top+height+"px";
	panel.style.left=left+"px";
	panel.style.display="block";

	var param="itemCd="+sender.value+"&rsvDiv=0"+"&tempFlg=0"+"&delDiv=0";

	try {
		var frm = document.main;
		var objs = frm["invCate"];
		if (objs[1].checked == true){
			//仮入出庫
			param += "&afterProc=1";
		}
	} catch (e) {

	}

	object.doXmlRequest(object,sender,param);
}


/**
* リスト選択時コールバック処理
*/
function list_onSelect(object,sender,json){
	var panel = document.getElementById("dropdown-panel");
	panel.style.display="none";
	sender.focus();

	//----------
	var name=sender.name;
	var idx=name.substring(name.indexOf("[")+1,name.length-1);

	document.getElementById("findItemNo").value=json.itemcd;


	//hidden値として格納
	document.getElementById("itemNm_hid").value=json.itemnm;     	//品番名
	document.getElementById("itemNo1_hid").value=json.itemcd1;		//Y品番1
	document.getElementById("itemNo2_hid").value=json.itemcd2;  	//Y品番2
	document.getElementById("model_hid").value=json.model;      	//型式
	document.getElementById("unitPrice_hid").value=json.unitprice;  //単価
	document.getElementById("leadTm_hid").value=json.leadtm;  		//L/T

	document.getElementById("odrLot_hid").value=json.odrlot;  		//発注単位
	document.getElementById("machineNo_hid").value=json.machinename;  //設備機番(名)
	document.getElementById("machineNoKey_hid").value=json.machineno;  //設備機番（キー）

	document.getElementById("newStock_hid").value=json.newstock;    //新品在庫数
	document.getElementById("useStock_hid").value=json.usestock;    //中古在庫数

	document.getElementById("odrPoint_hid").value=json.odrpoint;    //発注点
	document.getElementById("basicStock_hid").value=json.basicstock;//基準在庫

	document.getElementById("updateDt_hid").value=json.updatedt;    //更新日
	document.getElementById("updateDt_stock").value=json.stockupdate;    //更新日(在庫)
	

	
	//Y品番を再選択した時に背景色の色を白に戻す
	setBgWhite();
	
	
	//新品在庫数 , 中古在庫数 nullチェック
	if(document.getElementById("newStock_hid").value == "null"){
		document.getElementById("newStock_hid").value = 0;
	}
	if(document.getElementById("useStock_hid").value == "null"){
		document.getElementById("useStock_hid").value = 0;
	}

	if(json.picfilenm){
		document.getElementById("picfileNm_hid").value = json.picfilenm;
	}


}




//Y品番を再選択した時に背景色の色を白に戻す
function setBgWhite(){

	var odrDt  =  document.getElementById("odrDt");  				        //発注日
	var delvOdrObj = document.getElementById("delvOdr"); 					//出庫オーダーOBJ
	var delvOdr = delvOdrObj.options[delvOdrObj.selectedIndex];				//出庫オーダー
	var useUsrObj = document.getElementById("useUsr");						//使用者
	var useUsr = useUsrObj.options[useUsrObj.selectedIndex];
	var arrPlanDt  =  document.getElementById("arrPlanDt") 		 			//入荷予定年月日
	var signboardSheet = document.getElementById("signboardSheet") 			//看板枚数
	var useMeth = document.getElementById("useMethTxt");					//使用用途
	var odrUsrObj = document.getElementById("odrUsr");						//発注担当者(組)
	var usrListObj = document.getElementById("usrList");					//発注担当者
	var usrList = usrListObj.options[usrListObj.selectedIndex];
	 

	 //============
	 //背景色解除
	 //============
		odrDt.style.backgroundColor = 'white';
		delvOdrObj.style.backgroundColor = 'white';
		useUsrObj.style.backgroundColor = 'white';
		arrPlanDt.style.backgroundColor = 'white';
		signboardSheet.style.backgroundColor = 'white';
		useMeth.style.backgroundColor = 'white';
		usrListObj.style.backgroundColor = 'white';
		odrUsrObj.style.backgroundColor = 'white';
		 
	
}




function getElementsByClassName(parent,tagName,className,fullMatch){
	var i=0,j=0;
	var result = [], cnt = 0;
	var list = parent.getElementsByTagName(tagName);
	for ( i=0; i<list.length; i++ ){
		var name = list[i].className;
		if ( name ){
			var nameList = name.split(' ');
			for ( j=0; j<nameList.length; j++ ){
				if ( fullMatch ){
					if ( nameList[j] == className ){
						result[cnt++] = list[i];
					}
				}else{
					if ( nameList[j].indexOf(className) != -1 ){
						result[cnt++] = list[i];
					}
				}
			}
		}
	}
	return result;
}
//----------------------------------------------------------------------



//=======================================================select変更連動
//===========================================
//組がが変更された時の処理
//===========================================
//子ノード作成
function selectIn(obj,arrVar,arrTxt){
	var strObject = document.getElementById(obj);
	for(var k=0; k < arrVar.length; k++){
		//optionのvalue属性にセット(key)
		var ele = document.createElement("option");
		ele.value = arrVar[k];
		//optionにセット(value)
		var str = document.createTextNode(arrTxt[k]);
		ele.appendChild(str);

		strObject.appendChild(ele);
	}
}


//子ノード削除
function selectDel(Obj){
	var strObject = document.getElementById(Obj);
	for(var i= strObject.childNodes.length-1; i >= 0;i--) {
		strObject.removeChild(strObject.childNodes[i]);
	}
}


function reformWork(){
	var strWorkCd1Txt= new Array();
	var strWorkNm1Val= new Array();

	var strWorkCd1Txt2= new Array();
	var strWorkNm1Val2= new Array();

	strWorkCd1Txt[0] = "";
	strWorkNm1Val[0] = "";

	strWorkCd1Txt2[0] = "";
	strWorkNm1Val2[0] = "";

	 //=======================================
	 //組リスト取得
	 //=======================================
	 <%
	 Odr1000Bean.PullData[] work1NmPullList =formBean.getInputEmpPullList();

	 for (int j=0; j < work1NmPullList.length; j++){
		 Odr1000Bean.PullData  data = work1NmPullList[j];
 	%>
 		strWorkCd1Txt[<%=j+1%>] = "<%=data.value%>"
	 	strWorkNm1Val[<%=j+1%>] = "<%=data.key%>"
	<%}%>
	   //作業内容の子ノードを削除
	   selectDel("odrUsr");
	   //子ノードを作成
	   selectIn("odrUsr",strWorkNm1Val,strWorkCd1Txt);


	 //=======================================
	 //発注担当リスト取得
	 //=======================================
	 <%
	 Odr1000Bean.PullData[] work2NmPullList =formBean.getInputEmpPullList2();

	 for (int j=0; j < work2NmPullList.length; j++){
		 Odr1000Bean.PullData  data = work2NmPullList[j];
 	%>
 		strWorkCd1Txt2[<%=j+1%>] = "<%=data.value%>"
 		strWorkNm1Val2[<%=j+1%>] = "<%=data.key +"*"+ data.key2%>"
	<%}%>
	   //作業内容の子ノードを削除
	   selectDel("usrList");
	   //子ノードを作成
	   selectIn("usrList",strWorkNm1Val2, strWorkCd1Txt2);


}



//組の区分選択により
function odrUsrSideDell(odrUsr){
	var strWorkCd1Txt= new Array();
	var strWorkNm1Val= new Array();
	var arrCnt=1;
	strWorkCd1Txt[0] = "";
	strWorkNm1Val[0] = "";

	//発注担当者の子ノードを削除
	selectDel("usrList");

	 <%
		 Odr1000Bean.PullData[] work1ForWork2List =formBean.getInputEmpPullList2();
		 for (int j=0; j < work1ForWork2List.length; j++){
			 Odr1000Bean.PullData  data = work1ForWork2List[j];
	 %>
		 	if(odrUsr.value == "<%=data.key%>"){
		 		strWorkCd1Txt[arrCnt] = "<%=data.value%>"
			 	strWorkNm1Val[arrCnt] = "<%=data.key  +"*"+ data.key2%>"
			 	arrCnt++;
			//組の区分が何も選択ない場合
		 	}else if(odrUsr.value == ""){
		  		reformWork();
		 		return;
		 	}
  	 <%}%>


   //子ノードを作成
   selectIn("usrList",strWorkNm1Val,strWorkCd1Txt);



}


//担当者の区分選択により
function odrUsrSideDell2(usrList){
	var strWorkCd1Txt= new Array();
	var strWorkNm1Val= new Array();
	var arrCnt=1;
	strWorkCd1Txt[0] = "";
	strWorkNm1Val[0] = "";


	//key1とkey2を分ける
	var usrListArr = usrList.value.split("*");


	//発注担当者の子ノードを削除
	selectDel("odrUsr");

	 <%
		 Odr1000Bean.PullData[] work1ForWorkList =formBean.getInputEmpPullList();
		 for (int j=0; j < work1ForWorkList.length; j++){
			 Odr1000Bean.PullData  data = work1ForWorkList[j];
	 %>
		 	if(usrListArr[0] == "<%=data.key%>"){
		 		strWorkCd1Txt[arrCnt] = "<%=data.value%>"
			 	strWorkNm1Val[arrCnt] = "<%=data.key%>"

			 	arrCnt++;
			//組の区分が何も選択ない場合
		 	}else if(usrList.value == ""){
		  		reformWork();
		 		return;
		 	}
	 <%}%>


 //子ノードを作成
 selectIn("odrUsr",strWorkNm1Val,strWorkCd1Txt);

 //発注担当者による組の自動選択
 document.getElementById("odrUsr").selectedIndex = 1;

}

//=======================================================select変更連動

//日付を取得
var get_current_timestamp = function() {
    var weeks = new Array('日', '月', '火', '水', '木', '金', '土');
    var d = new Date();

    // 年月日・曜日・時分秒の取得
    var month  = d.getMonth() + 1;
    var day    = d.getDate();
    var week   = weeks[ d.getDay() ];
    var hour   = d.getHours();
    var minute = d.getMinutes();
    var second = d.getSeconds();

    // 1桁を2桁に変換する
    if (month < 10) {month = "0" + month;}
    if (day < 10) {day = "0" + day;}
    if (hour < 10) {hour = "0" + hour;}
    if (minute < 10) {minute = "0" + minute;}
    if (second < 10) {second = "0" + second;}

    // 整形して返却
    return d.getFullYear()  + "-" + month + "-" + day;
    //return d.getFullYear()  + "/" + month + "/" + day + "（" + week + "） " + hour + ":" + minute + ":" + second;
}



//確定ボタン押下
function confirmBtn(){
	findItemNo = document.getElementById("findItemNo").value;

	
	//未入力をチェック
	if(findItemNo==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "Y品番")%>"); //$1が入力されていません。
		return;
	}else if(document.getElementById("itemNo1_hid").value ==""){
		alert_Custom("<%=Message.getMessage("WRN01180")%>");
		return;
	}

	//確定時にログインユーザコードをデフォルト値せセット
	selectedChange("usrList",<%=formBean.getUsrListKey()%>);
	odrUsrSideDell2(document.getElementById("usrList"));


	document.getElementById("itemNm").value = document.getElementById("itemNm_hid").value;
	document.getElementById("itemNo1").value = document.getElementById("itemNo1_hid").value;
	document.getElementById("itemNo2").value = document.getElementById("itemNo2_hid").value;
	document.getElementById("model").value = document.getElementById("model_hid").value;
	document.getElementById("unitPrice").value = document.getElementById("unitPrice_hid").value;
	document.getElementById("leadTm").value = document.getElementById("leadTm_hid").value;
	document.getElementById("machineNo").value = document.getElementById("machineNo_hid").value;

	document.getElementById("odrDt").value = get_current_timestamp(); //発注日（今日の日付を表示）

	document.getElementById("orderNum").value = 0;
	
	var basePath = "<%=appMng.getAppConfig("userconfig.imagepath")%>";
	document.getElementById("picfileNm").src = basePath+document.getElementById("picfileNm_hid").value;


	loadText(document.getElementById("odrDt"));  //入荷予定年月日をセット
	
	
	//再確定時、発注数量を
	afterInputData(document.getElementById("signboardSheet"));

}


//数値を3桁区切りで表示
function addFigure(str) {
	 var num = new String(str).replace(/,/g, "");
	 while(num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2")));
	 return num;
}




//=================================================================
//	データ入力後の処理（看板枚数による発注数量の処理）
//=================================================================
function afterInputData(obj) {
	
	obj.value = obj.value.replace(",","");  //コンマを除去
	
	
	//発注数量入力（発注単位＊看板枚数）
	var odrNumRst = document.getElementById("odrLot_hid").value * obj.value;
	
	document.getElementById("orderNum").value = addFigure(odrNumRst);
	
	obj.value = addFigure(obj.value);
}
//--------------------------------
//カンマ削除関数
//--------------------------------
function delComma(w) {
  var z = w.replace(/,/g,"");
  return (z);
}

//--------------------------------
//	型変換 String→Numeric
//--------------------------------
function convStrToNum(strVal) {
	var cnv = Number(strVal);
	var res = 0;
	if(isNaN(cnv)) {
		// 数値じゃない!
	} else {
		res = cnv;
	}
	return res;
}
//<!-- NumKeyBoard END -->
//----------------------------------------------------------------------


function selectedChange(formSelectId, itemValue){
	var objSelect = document.getElementById(formSelectId);
	var m = objSelect.length;
	var i = 0;

	for(i=0;m>i;i++){
		var arr = objSelect.options[i].value.split("*");

		if(arr[1] == itemValue){
			objSelect.options[i].selected = true;
			break;
		}
	}
}



function nextPageJump(nextPage){

	mainForm = document.getElementById("F1");
	document.getElementById("nextPage").value = nextPage;

	mainForm.submit();
}


//戻るボタン押下
function backBtn(nextPage){
	mainForm = document.getElementById("F1");
	document.getElementById("nextPage").value = nextPage;
	document.getElementById("orderExe").value = ""; //発注実行を弾くために

	//確定されたものが無いとメイン画面にすぐ遷移
	var itemNo1 = document.getElementById("itemNo1").value;

	if(itemNo1 != ""){
		//発注処理を中止します。よろしいですか？
		if ("undefind"!=confirm_Custom("<%=Message.getMessage("INF01040").replace("$1", "発注処理")%>")){
			return ;
		}
	}

	mainForm.submit();
}




//「発注」ボタン押下
function orderBtn(){

	var itemNo1 = document.getElementById("itemNo1").value;

	//確定されたものが無いと無視
	if(itemNo1 == ""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "Y品番")%>");
		return ;
	}


	//確定時と発注時の更新日を比較
	 updateDtCheck();

}


//「クリア」ボタン押下
function clearBtn(){
	document.getElementById("nextPage").value = "";
	
	mainForm = document.getElementById("F1");
	document.getElementById("clearExe").value = "1";
	document.getElementById("orderExe").value = "";  //発注実行を弾くために

	//画面の内容を全てクリアします。よろしいですか？
	if ("undefind"!=confirm_Custom("<%=Message.getMessage("INF01010")%>")){
		return ;
	}


	mainForm.submit();
}


//======================================
//新品在庫数と中古在庫数チェック
function getStockCheck(){

	//======================================
	//新品在庫数と中古在庫数チェック
	//看板枚数×発注単位 > 新品在庫数＋中古在庫数、かつ新品在庫数 + 中古在庫数 <>0 のときはエラーメッセージを出力後、処理を抜ける
	//=======================================
	var odrPoint =document.getElementById("odrPoint_hid").value;	//発注点
	var basicStock =document.getElementById("basicStock_hid").value;//基準在庫

	var newStock =document.getElementById("newStock_hid").value;
	var useStock =document.getElementById("useStock_hid").value;
	var orderNum =document.getElementById("orderNum").value.replace(",","");	    //発注数量
	
	
	var signboardSheet = document.getElementById("signboardSheet") 				//看板枚数

	var totalStock =Number(newStock) + Number(useStock);

	// alert("newStock :"+newStock);
	// alert("useStock :"+useStock);
	// alert("totalStock :"+totalStock);
	// alert("orderNum :"+orderNum);
	// alert("totalStock - orderNum :"+ (totalStock - Number(orderNum)));

//	alert(	 "発注点　："+odrPoint + "\n"
//			+"基準在庫　："+basicStock+ "\n"
//			+"newStock　："+newStock+ "\n"
//			+"useStock　："+useStock+ "\n"
//			+"orderNum　："+orderNum+ "\n\n"
//			+"totalStock　："+totalStock);
	
	
	if(totalStock == 0){
		alert_Custom("<%=Message.getMessage("WRN01190")%>");
		 signboardSheet.style.backgroundColor = 'pink';  //色を付き
		
		return false;
	}else if(totalStock < orderNum){
		alert_Custom("<%=Message.getMessage("WRN01190")%>");
		 signboardSheet.style.backgroundColor = 'pink';  //色を付き
		 
		return false
	}else if(odrPoint < (totalStock - Number(orderNum))){
		alert_Custom("<%=Message.getMessage("WRN01080").replace("$1", "発注点")%>");
		 signboardSheet.style.backgroundColor = 'pink';  //色を付き
		 
		return false;
	}else if(basicStock < (totalStock - Number(orderNum))){
		alert_Custom("<%=Message.getMessage("WRN01080").replace("$1", "基準在庫数")%>");
		 signboardSheet.style.backgroundColor = 'pink';  //色を付き
		 
		return false;
	}
	
	 signboardSheet.style.backgroundColor = 'white';

	return true;
}




//パップアップ解除
function back(){
	document.getElementById("opAlertBtn").style.display = "none";
	document.getElementById("opAlert").style.display = "none";
	document.getElementById("opAlertButton").style.display = "none";
	document.getElementById("opAlertTop").style.display = "none";
	document.getElementById("allbackgr").style.display = "none";
}


//入力チェックによる背景色を付ける
function validCheck(){
	
	var odrDt  =  document.getElementById("odrDt");  				        //発注日
	
	var delvOdrObj = document.getElementById("delvOdr"); 				//出庫オーダーOBJ
	var delvOdr = delvOdrObj.options[delvOdrObj.selectedIndex];		//出庫オーダー

	var useUsrObj = document.getElementById("useUsr");					//使用者
	var useUsr = useUsrObj.options[useUsrObj.selectedIndex];
	
	var arrPlanDt  =  document.getElementById("arrPlanDt") 		 //入荷予定年月日
	var signboardSheet = document.getElementById("signboardSheet") //看板枚数
	var useMeth = document.getElementById("useMethTxt");				//使用用途
	 
	var odrUsrObj = document.getElementById("odrUsr");				//発注担当者(組)
	var usrListObj = document.getElementById("usrList");				//発注担当者
	var usrList = usrListObj.options[usrListObj.selectedIndex];
	 
	 //============
	 //背景色付ける
	 //============
	 if(odrDt.value==""){
		odrDt.style.backgroundColor = 'pink';
	 }
	 if(delvOdr.value==""){
		 delvOdrObj.style.backgroundColor = 'pink';
	 }
	 if(useUsr.value==""){
		 useUsrObj.style.backgroundColor = 'pink';
	 }
	 if(arrPlanDt.value==""){
		 arrPlanDt.style.backgroundColor = 'pink';
	 }
	 if(signboardSheet.value==""){
		 signboardSheet.style.backgroundColor = 'pink';
	 }
	 if(useMeth.value==""){
		 useMeth.style.backgroundColor = 'pink';
	 }
	 if(usrList.value==""){
		 usrListObj.style.backgroundColor = 'pink';
		 odrUsrObj.style.backgroundColor = 'pink';
	 }
	 //============
	 //背景色解除
	 //============
	 if(odrDt.value!=""){
		odrDt.style.backgroundColor = 'white';
	 }
	 if(delvOdr.value!=""){
		delvOdrObj.style.backgroundColor = 'white';
	 }
	 if(useUsr.value!=""){
		 useUsrObj.style.backgroundColor = 'white';
	 }
	 if(arrPlanDt.value!=""){
		 arrPlanDt.style.backgroundColor = 'white';
	 }
	 if(signboardSheet.value!=""){
		 signboardSheet.style.backgroundColor = 'white';
	 }
	 if(useMeth.value!=""){
		 useMeth.style.backgroundColor = 'white';
	 }
	 if(usrList.value!=""){
		 usrListObj.style.backgroundColor = 'white';
		 odrUsrObj.style.backgroundColor = 'white';
		 
	 }
}





//「発注」実行
function orderBtnExe(){
	mainForm = document.getElementById("F1");


   //----------------------------------------------


	var delvOdrObj = document.getElementById("delvOdr"); 				//出庫オーダー
	var delvOdr = delvOdrObj.options[delvOdrObj.selectedIndex].value;

	var useMeth = document.getElementById("useMethTxt").value;				//使用用途
	//var useMeth = useMethObj.options[useMethObj.selectedIndex].value;

	var usrListKey = document.getElementById("usrListKey");		//発注担当者 キー
	var usrListObj = document.getElementById("usrList");				//発注担当者
	var usrListArr = usrListObj.options[usrListObj.selectedIndex].value.split("*");

	if(usrListArr[1]){
		usrListKey.value = usrListArr[1];
	}else{
		usrListKey.value ="";
	}

	var useUsrObj = document.getElementById("useUsr");					//使用者
	var useUsr = useUsrObj.options[useUsrObj.selectedIndex].value;

	var odrDt  =  document.getElementById("odrDt").value;  				//発注日

	var arrPlanDt  =  document.getElementById("arrPlanDt").value; 		 //入荷予定年月日

	var signboardSheet = document.getElementById("signboardSheet").value; //看板枚数
	var signboardSheetMinus =  signboardSheet.indexOf("-");
	
	var orderNumLen = document.getElementById("orderNum").value.length;	    //発注数
	
		
	
	validCheck();//入力チェックによる背景色を付ける
	
	
	if(odrDt ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "発注日")%>");
		return ;
	}else if(!ckDate(odrDt)){
		alert_Custom("<%=Message.getMessage("WRN00030").replace("$1", "発注日")%>"); //不正な日付です。
		return ;
	}else if(delvOdr ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "出庫オーダー")%>");
		return ;
	}else if(signboardSheet ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "看板枚数")%>");
		return ;
	}else if(signboardSheet =="0" || signboardSheetMinus == 0){
		alert_Custom("<%=Message.getMessage("WRN00060").replace("$1", "看板枚数")%>");
		return ;
	}else if(orderNumLen > 6){
		alert_Custom("<%=Message.getMessage("WRN01300").replace("$1", "5")%>");
		return ;
	}else if(useMeth ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "使用用途")%>");
		return ;
	}else if(arrPlanDt ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "入荷予定年月日")%>");
		return ;
	}else if(usrListKey.value ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "発注担当者")%>");
		return ;
	}else if(useUsr ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "使用者")%>");
		return ;
	}else if(odrDt > arrPlanDt){
		alert_Custom("<%=Message.getMessage("WRN00040").replace("$1", "入荷予定年月日").replace("$2", "発注日")%>");
		return ;
	}else{

		

		var newStock =document.getElementById("newStock_hid").value;
		var useStock =document.getElementById("useStock_hid").value;
		var orderNum =document.getElementById("orderNum").value.replace(",","");	    //発注数量

		//新品在庫数と中古在庫数チェック
		if(!getStockCheck()){
			return;
		}


		var afterFunc="yesCancelBtn();"
		if (!confirm_Custom3("<%=Message.getMessage("INF01030").replace("$1", "直結看板予備品")%>",afterFunc)){
			return ;
		}

	}
}

//「はい」を押された時
function yesCancelBtn(){
	
	var newStock =document.getElementById("newStock_hid").value;
	var useStock =document.getElementById("useStock_hid").value;
	var orderNum =document.getElementById("orderNum").value;	    //発注数量
	
	
	
	//新品在庫数 = 新品在庫数 - 発注数量
	//中古在庫数 = 中古在庫数
	if(Number(newStock) >= Number(orderNum)){
		document.getElementById("newStock_hid").value = (Number(newStock) - Number(orderNum));
		
	}else{
	//中古在庫数 = 中古在庫数 - (発注数量 - 新品在庫数)
		document.getElementById("useStock_hid").value = Number(useStock) - (Number(orderNum) - Number(newStock));
	}

	document.getElementById("orderExe").value = "1";
	
	//設備機番キーを渡す
	document.getElementById("machineNo").value = document.getElementById("machineNoKey_hid").value;
	
	mainForm = document.getElementById("F1");
	mainForm.submit();
}




//使用用途SELECTによる使用用途TEXTにセット
function setUseMeth(){

	var useMethSel = document.getElementById("useMeth");
	var useMethTxt = document.getElementById("useMethTxt");

	useMethTxt.value = useMethSel.options[useMethSel.selectedIndex].text;
}



//*************************************************
//AJAX 部分(発注日による入荷予定年月日の計算処理)
//*************************************************
function loadText(obj){

	var leadTime = document.getElementById("leadTm").value;

	//leadTimeがNULLなら１をセット
//	if(leadTime=='0'){
//		leadTime = 1;
//	}

	//leadTimeがNULLまた""なら弾かれる
	if(leadTime != "" && leadTime!=null){

		xmlHttp = new XMLHttpRequest();
		xmlHttp.onreadystatechange = checkStatus;
		xmlHttp.open("GET","../odr1001/odr1001?orderDt="+obj.value+"&leadTm="+leadTime,true);
		xmlHttp.send(null);

	}
}

function checkStatus(){
	if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
		var xml = xmlHttp.responseXML;
		var rootNodes = xml.getElementsByTagName("list");
		var rootNode = rootNodes[0];
		var json = JSONConvert(rootNode);
		if (json==null) {

		}else {

			//入荷予定年月日セット
			document.getElementById("arrPlanDt").value = json.date;
		}
	}
}

function JSONConvert(node){
	var type = node.nodeType;
	if ( isTextNode(node) ){
		var text = getTextValue(node);
		return text;
	}
	if ( type==1 ){
		var json = {};
		var nodeName = node.nodeName;
		var childs = node.childNodes;

		for (var i = 0; i<childs.length; i++){
			var child = childs[i];
			var obj = json[child.nodeName];

			if ( child.nodeType == 1 ){
				if ( obj ){
					var array = null;
					if ( !isArray(obj) ){
						array=[];
						array[array.length]=obj;
					}else{
						array=json[child.nodeName];
					}
					array[array.length]=JSONConvert(child);
					json[child.nodeName]=array;
				}else{
					json[child.nodeName]=JSONConvert(child);
				}
			}
		}
		return json;
	}
}

function isTextNode(node){
	if ( node.hasChildNodes() ){
		var childs = node.childNodes;
		for (var i = 0; i<childs.length; i++){
			var child = childs[i];
			if ( child.nodeType != 3 ) return false;
		}
	}
	return true;
}

function getTextValue(node){
	if ( node.hasChildNodes() ){
		var childs = node.childNodes;
		var child = childs[0];
		if ( child.nodeType == 3 ){
			return child.nodeValue;
		}
	}
	return null;
}
//------------------------------------------------------------------------------


//*************************************************
//AJAX 部分(確定時と発注時の更新日を比較)
//*************************************************
function updateDtCheck(){

	var findItemNo = document.getElementById("itemNo1").value + "-" +document.getElementById("itemNo2").value;

	xmlHttp = new XMLHttpRequest();
	xmlHttp.onreadystatechange = checkStatus2;
	xmlHttp.open("GET","../odr1002/odr1002?itemCd="+findItemNo,true);
	xmlHttp.send(null);

}

function checkStatus2(){
	if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
		var xml = xmlHttp.responseXML;
		var rootNodes = xml.getElementsByTagName("list");
		var rootNode = rootNodes[0];
		var json = JSONConvert(rootNode);
		if (json==null) {
		}else {
			var orderUpdateDt = json.updatedt; 	  //予備品M更新日（発注）
			var stockUpdateDt = json.stockupdate; //在庫更新日（発注）
			
			
			var confirmUdateDt = document.getElementById("updateDt_hid").value; //予備品M更新日(確定)
			var confirmUdateStock = document.getElementById("updateDt_stock").value; //在庫更新日(確定)

			//alert("在庫更新日(確定)   confirmUdateStock  :"+ confirmUdateStock + "\n"+ "在庫更新日（発注）   stockUpdateDt  :"+ stockUpdateDt);
			//alert("予備品M更新日(確定)   confirmUdateDt  :"+ confirmUdateDt + "\n"+ "予備品M更新日（発注）   orderUpdateDt  :"+ orderUpdateDt);
			

			//確定時と発注時の更新日を比較
			if((orderUpdateDt == confirmUdateDt) && (stockUpdateDt == confirmUdateStock)){
				document.getElementById("updateDtFlg").value = "1";
				orderBtnExe(); //発注実行

			}else{

				alert_Custom("<%=Message.getMessage("WRN01010")%>");
				//予備品のマスタ情報が既に変更されています。発注を再度やり直して下さい。
				return;
			}

		}
	}
}


function closeBtn(){
	var panel = document.getElementById("dropdown-panel");
	panel.style.display="none";
}






/****************************************************************
* 機　能： 入力された値が日付でYYYY/MM/DD形式になっているか調べる
* 引　数： datestr　入力された値
* 戻り値： 正：true　不正：false
****************************************************************/

function ckDate(datestr) {
    
	datestr = datestr.replace("-","/").replace("-","/");
	
    // 正規表現による書式チェック
    if(!datestr.match(/^\d{4}\/\d{2}\/\d{2}$/)){
        return false;
    }

    var vYear = datestr.substr(0, 4) - 0;

    var vMonth = datestr.substr(5, 2) - 1; // Javascriptは、0-11で表現

    var vDay = datestr.substr(8, 2) - 0;

    // 月,日の妥当性チェック

    if(vMonth >= 0 && vMonth <= 11 && vDay >= 1 && vDay <= 31){

        var vDt = new Date(vYear, vMonth, vDay);

        if(isNaN(vDt)){

            return false;

        }else if(vDt.getFullYear() == vYear && vDt.getMonth() == vMonth && vDt.getDate() == vDay){

            return true;

        }else{

            return false;
        }

    }else{

        return false;
    }

}



</script>


</head>

<body onLoad="onInit()">
<form name="main" id="F1" action="odr1000" method="post" class="frmMain">
<table style="">
	<!--HEADER TITLE START -->
	<tr style = "background-color:#e1e1e1;  font-weight: bold;  border-bottom:1px solid #e1e1e1; background: -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#ffffff));　 ">
		<td colspan="2" class ="header_tbl" style = "font-size:22px; height:40px;"  align = "left">
			　予備品管理システム (<%=formBean.kojou%>)　　　
			<span style="font-size:30px; text-shadow:2px 2px #666; 	color:#aaa;">直結看板新規発注画面</span>
		</td>
	</tr>
	<!--HEADER TITLE END -->

	<!--メインメニュー画面　START  -->
	<tr style="height:628px; ">

		<td>
			<table width ="100%"  class="mainTbl_Left">
				<!--発注 -->
				<tr>
					<td id="" align = "right"  valign="baseline" class="selTitle">Y品番:
					<input type="text"  class="item" name="findItemNo" id="findItemNo" maxlength="11"  value="" size="10"   style="width: 100px; height:25px; font-size:15px; color:blue;" onKeyup="dropdown.OnKeyUpObserver(dropdown,event);" onFocus="dropdown.OnFocusObserver(dropdown,event);" onBlur="dropdown.OnBlurObserver(dropdown,event);">　</td>
				</tr>
				<tr>
					<td align = "center" >
						　　　<input type="button" onclick="confirmBtn();" class="searchBtn" value="確 定" >
					</td>
				</tr>
			</table>
		</td>


		<td class="right" >
			 <!--<div class="mainLine" id = "mainLine" style="display:inline; " ></div>  -->

			<table width ="100%"  class="mainTbl_Right">
				<!--発注 -->
				<tr>
					<td id="" align = "left"  class="selTitle">　Y品番: 　
					<input type="text"  class="" name="itemNo1" id="itemNo1" style="width: 44px; height:25px; font-size:15px; color:blue; text-align: right; background-color:#CCC;"  value=""  readonly> -
					<input type="text"  class="" name="itemNo2" id="itemNo2" style="width: 44px; height:25px; font-size:15px; color:blue; text-align: right; background-color:#CCC;"  value=""  readonly>
					</td>

					<td id="" align = "left"   class="selTitle">　発注日:
					<input type="date"  class="" name="odrDt" id="odrDt" style="width: 93px; height:30px; font-size:15px; color:blue;" value=""  onChange="loadText(this);"></td>
				</tr>

				<tr>
					<td id="" align = "left"   valign="top"  class="selTitle" colspan="2">　品名:　　
					<textarea name="itemNm" id="itemNm" cols="40" rows="2" style="width:  300px; font-size:15px; color:blue; background-color:#CCC;"  readonly></textarea>

					<!-- <input type="text"  class="" name="" id="" style="width:  300px; height:25px; font-size:15px; color:blue;"  value=""> -->
					</td>
				</tr>
                <tr>
					<td id="" align = "left"   valign="top"  class="selTitle" colspan="2" >　型式:　　
					<textarea name="model" id="model" cols="40" rows="2" style="width:  300px; font-size:15px; color:blue; background-color:#CCC;"  readonly></textarea>

					<!-- <input type="text"  class="" name="" id="" style="width:  300px; height:25px; font-size:15px; color:blue;"  value=""> -->
					</td>
				</tr>
				<tr>
					<td id="" align = "left"   class="selTitle">　単価:　　
					<input type="text"  class="" name="unitPrice" id="unitPrice" style="width: 100px; height:25px; font-size:15px; color:blue; text-align:right; background-color:#CCC;"  value="" readonly></td>

					<td id="" align = "left"   class="selTitle">　L/T:
					<input type="text"  class="" name="leadTm" id="leadTm" style="width: 100px; height:25px; font-size:15px; color:blue; text-align:right; background-color:#CCC;"  value="" readonly></td>

					<td id="" align = "left"   class="">　出庫オーダー:　
						<select name="delvOdr"  id="delvOdr"  style="width:100px; height:30px; font-size:15px; color:blue;" onChange="">
								<option value=''></option>
								<%
								Odr1000Bean.PullData[] inputDelvOdrList = formBean.getInputDelvOdrList();
								for (int i = 0; inputDelvOdrList != null && i < inputDelvOdrList.length; i++) {
									Odr1000Bean.PullData data = inputDelvOdrList[i];
								%>
								<option value='<%=data.key%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
					</td>
				</tr>
				<tr>
					<td id="" align = "left"   class="selTitle">　発注数量:
					<input type="text"  class="" name="orderNum" id="orderNum" style="width: 100px; height:25px; font-size:15px; color:blue; text-align:right; background-color:#CCC;"  value="" readonly></td>
					<td id="" align = "left"   class="selTitle">　看板枚数:
					<input type="text"  class="" name="signboardSheet" id="signboardSheet"  onclick='clsNKB.setNumKeyBoard(this, 5, 0, true, 200);' onChange='afterInputData(this);' style="width: 60px; height:25px; font-size:15px; color:blue; text-align:right;" value="" readonly></td>
					<td id="" align = "left"   class="selTitle"  colspan="2">　使用用途:　　　
					<input type="text"  class="" name="useMethTxt" id="useMethTxt" maxlength="50"  style="width: 100px; height:25px; font-size:15px; color:blue; text-align:left;" value="" >
						<select name="useMeth"  id="useMeth"  style="width:22px; height:35px; font-size:15px; color:blue;" onChange='setUseMeth(this);'>
								<option value=''></option>
								<%
								Odr1000Bean.PullData[] inputUseMethList = formBean.getInputUseMethList();
								for (int i = 0; inputUseMethList != null && i < inputUseMethList.length; i++) {
									Odr1000Bean.PullData data = inputUseMethList[i];
								%>
								<option value='<%=data.key%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
					</td>
					<td></td>
				</tr>


				<tr>
					<td id="" align = "left"   class="selTitle">　設備機番:
					<input type="text"  class="" name="machineNo" id="machineNo" style="width: 100px; height:25px; font-size:15px; color:blue; background-color:#CCC;" value="" readonly></td>

<td></td>
					<td id="" align = "left"   class="selTitle">　入荷予定年月日:
					<input type="date"  class="" name="arrPlanDt" id="arrPlanDt" style="width: 100px; height:30px; font-size:15px; color:blue;"  value=""></td>
				</tr>

				<!--線を引く -->
				<tr><td  colspan="4"><hr></td></tr>

				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">　発注担当者:
						<select name="odrUsr"  id="odrUsr"  style="width:100px; height:30px; font-size:15px; color:blue;" onChange="odrUsrSideDell(this);">
								<option value=''></option>
								<%
								Odr1000Bean.PullData[] inputEmpPullList = formBean.getInputEmpPullList();
								for (int i = 0; inputEmpPullList != null && i < inputEmpPullList.length; i++) {
									Odr1000Bean.PullData data = inputEmpPullList[i];
								%>
								<option value='<%=data.key%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
						<select name="usrList"  id="usrList"  style="width:100px; height:30px; font-size:15px; color:blue;" onChange="odrUsrSideDell2(this);">
								<option value=''></option>
								<%
								Odr1000Bean.PullData[] inputEmpPullList2 = formBean.getInputEmpPullList2();
								for (int i = 0; inputEmpPullList2 != null && i < inputEmpPullList2.length; i++) {
									Odr1000Bean.PullData data = inputEmpPullList2[i];
								%>
								<option value='<%=data.key + "*" + data.key2%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
					</td>


					<td id="" align = "right"   class="selTitle">使用者:
						<select name="useUsr"  id="useUsr"  style="width:150px; height:30px; font-size:15px; color:blue;" onChange="">
								<option value=''selected></option>
								<%
								Odr1000Bean.PullData[] inputUseUsrList = formBean.getInputUseUsrList();
								for (int i = 0; inputUseUsrList != null && i < inputUseUsrList.length; i++) {
									Odr1000Bean.PullData data = inputUseUsrList[i];
								%>
								<option value='<%=data.key%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
					</td>
				</tr>
				<tr>
					<td></td>
					<td align = "right" >
						<input type="button"  onclick="clearBtn();" class="clearBtn"  value="クリア">　
					</td>
					<td align = "right" >
						<input type="button"  onclick="orderBtn();" class="orderBtn"  value="発注">　　
					</td>
					<td align = "right" >
						<input type="button"  onclick="backBtn('top1000');" class="backBtn"  value="戻る">　
					</td>
				</tr>

			</table>

			<!--ログインMAIN画面　END  -->
		</td>
	</tr>
</table>
	<!-- <div class='footer' align='right' style="font-size:35px; color: crimson; font-weight: 700; align:top;" >TOYOTA&nbsp;&nbsp;</div> -->
	<div class='footer' align='right' style="font-size:35px; background-image: url(../../common/img/toyotaB.png); background-repeat: no-repeat; align:top;" ></div> 
	<div class='ImageZone' align='right' style="font-size:20px; align:top"><img id="picfileNm"  class="image" src='<%=appMng.getAppConfig("userconfig.imagepath")%>' height='180px' width='330px'></div>
	<div id="NumKeyBoardID"></div>

	<!-- ITEM-DROPDOWN START -->
	<div class="dropdown-panel" id="dropdown-panel">
		<div class="dropdown-panel-in">
			<div class="header">
				<div style="float:left;width:110px;height:20px;">
					<table border=0>
						<tr>
							<td style="width:110px;height:20px;">品番</td>
						</tr>
					</table>
				</div>
				<div style="float:right;width:40px;text-align:right;">
					<button class="closebtn" type="button" onClick="closeBtn();" style="width:18px; height:17px; padding:0px;">
						<img src="../../common/js/dropdown/close.gif" alt="閉じる">
					</button>
				</div>
			</div>
			<div class="drop-contents" id="drop-contents">
			</div>
			<div class="footer"></div>
		</div>
	</div>
	<!-- ITEM-DROPDOWN END -->


	<!--警告 ポップアップ---------------------------------------------------------------------------- -->
	<div id="allbackgr" class="allbackgr" style="display:none;"></div>
	<div class="opAlertBtn" id = "opAlertBtn" style="display:none;" ></div>
	<div class="opAlertButton" id = "opAlertButton" style="display:none;" ></div>
	<div class="opAlertTop" id = "opAlertTop" style="display:none; font-size:22px;">　予備品管理システム　</div>
	<div class="opAlert" id = "opAlert" style="display:none;"></div>
	<!-- -------------------------------------------------------------------------------------------- -->


	<input type="hidden" id="nextPage" name="nextPage" value="">

	<input type="hidden" id="itemNm_hid" name="itemNm_hid" value="">
	<input type="hidden" id="itemNo1_hid" name="itemNo1_hid" value="">
	<input type="hidden" id="itemNo2_hid" name="itemNo2_hid" value="">
	<input type="hidden" id="model_hid" name="model_hid" value="">
	<input type="hidden" id="unitPrice_hid" name="unitPrice_hid" value="">
	<input type="hidden" id="leadTm_hid" name="leadTm_hid" value="">
	<input type="hidden" id="machineNo_hid" name="machineNo_hid" value="">
	<input type="hidden" id="odrLot_hid" name="odrlot_hid" value="">
	<input type="hidden" id="updateDt_hid" name="updateDt_hid" value="">
	<input type="hidden" id="updateDt_stock" name="updateDt_stock" value="">
	
	<input type="hidden" id="picfileNm_hid" name="picfileNm_hid" value="">

	<input type="hidden" id="newStock_hid" name="newStock_hid" value="">
	<input type="hidden" id="useStock_hid" name="useStock_hid" value="">
	<input type="hidden" id="odrPoint_hid" name="odrPoint_hid" value="">
	<input type="hidden" id="basicStock_hid" name="basicStock_hid" value="">

	<input type="hidden" id="orderExe" name="orderExe" value="">
	<input type="hidden" id="clearExe" name="clearExe" value="">
	<input type="hidden" id="updateDtFlg" name="updateDtFlg" value="">

	<input type="hidden" id="stateFlg" name="stateFlg" value="">
	<input type="hidden" id="usrListKey" name="usrListKey" value="">
	<input type="hidden" id="machineNoKey_hid" name="machineNoKey_hid" value="">
</form>
	
</body>
</html>
